package com.gaojiabao.panghu.constant;

import lombok.Getter;

/**
 * 统一返回结果状态信息类
 *
 * @author gaojiabao
 */
@Getter
public enum ResultCodeEnum {
    SUCCESS(200, "success"),
    SERVER_ERROR(500, "Unknown error,Please contact the administrator"),
    USERNAME_ERROR(501, "Username error"),
    PASSWORD_ERROR(503, "Password error"),
    NOTLOGIN(504, "Not login or login has expired"),
    USERNAME_USED(505, "UserName Used"),

    //登录状态
    LOGIN_PARAM_EMPTY(506, "Username and password are not allowed to be empty"),
    LOGIN_ERROR(507, "Wrong username or password "),

    //路径参数
    PATH_PARAM_ERROR(508, "Error in path parameter"),
    REQUEST_BODY_ERROR(509, "Error in request body"),

    //community状态
    COMMUNITY_PARAM_ERROR(510, "Error in paging parameter"),
    COMMUNITY_NO_ID(511, "The community for this id does not exist"),
    COMMUNITY_DELETE_ERROR(512, "Error in deleting the community"),
    COMMUNITY_UPDATE_ERROR(513, "Error in updating the community"),
    COMMUNITY_NO_CONDITION(514,"Query parameters can't be all null"),
    COMMUNITY_ADD_ERROR(515,"Error in adding community"),

    //store状态
    STORE_NO_ID(516,"The store for this id does not exist"),

    //sql状态
    RECORD_ADD_ERROR(550,"Error in adding the record"),
    RECORD_DELETE_ERROR(551,"Error in deleting the record"),
    RECORD_UPDATE_ERROR(552,"Error in updating the record"),
    RECORD_GET_ERROR(553,"Error in getting the record")

    ;

    private final Integer code;
    private final String message;

    private ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}